<template>
	<view>
		<view style="padding-top: 35vh;" class="text-center padding-lr-xl">
			<view class="text-gray text-sm">未登录</view>
			<view @click="doLogin()" class='cu-btn bg-green lg block shadow radius margin-xl'>
				立即登录
			</view>
		</view>
	</view>
</template>

<script>
	import UserApi from "@/api/user"
	import {
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {

			}
		},
		onShow() {
			this.logout()
		},
		methods: {
			...mapMutations(['logout','login','stat']),
			doLogin() {
				// UserApi.login({
				// 	test: 696
				// }).then((res) => {
				// 	this.login(res)
				// 	UserApi.stat().then((res) => {
				// 		this.stat(res)
				// 	})
				// })
				UserApi.login().then((res) => {
					window.location.href = res
				})
			}
		}
	}
</script>

<style>

</style>
